Making Trx Logger Hierarchical for ordered test and data driven tests#1330
Making Trx Logger Hierarchical for ordered test and data driven tests#1330abhishkk merged 31 commits intomicrosoft:masterfrom
Conversation
| /// <summary> | ||
| /// Test aggregation element. | ||
| /// </summary> | ||
| internal abstract class TestAggregation : TestElement, ITestAggregation |
There was a problem hiding this comment.
TestAggregation [](start = 28, length = 15)
can we rename to TestElementAggregation..?
| base.Save(element, parameters); | ||
|
|
||
| XmlPersistence h = new XmlPersistence(); | ||
| if (testLinks.Count > 0) |
There was a problem hiding this comment.
Nit: Please add parenthesis.
| var parentExecutionId = Converter.GetParentExecutionId(e.Result); | ||
| var parentTestResult = GetTestResult(parentExecutionId); | ||
| var parentTestElement = (parentTestResult != null) ? GetTestElement(parentTestResult.Id.TestId) : null; | ||
| if (parentTestResult == null || parentTestElement == null || parentExecutionId == Guid.Empty) |
There was a problem hiding this comment.
Write a coment when we are switching to flatten way
smadala
left a comment
There was a problem hiding this comment.
- Please measure perf impact.
| // Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
|
||
| using System; | ||
| using System.Collections.Generic; |
There was a problem hiding this comment.
Nit: Move using statements to under namespace block.
| private Guid executionId; | ||
| private Guid parentExecutionId; | ||
| private TestListCategoryId categoryId; | ||
| private List<TestEntry> testEntries = new List<TestEntry>(); |
There was a problem hiding this comment.
Create object if required? Do same in other places too.
| { | ||
| if (parentTestElement != null && | ||
| parentTestElement.TestType.Equals(TrxLoggerConstants.OrderedTestType) && | ||
| !(parentTestElement as OrderedTestElement).TestLinks.ContainsKey(testElement.Id.Id)) |
There was a problem hiding this comment.
When you get same testElement more than once?
There was a problem hiding this comment.
In case orderedtest has data driven test, then we get same test element for all data driven tests. In that case we want to update test link only once.
| // Create trx test element from rocksteady test case | ||
| var testElement = GetOrCreateTestElement(executionId, parentExecutionId, testType, parentTestElement, e.Result.TestCase); | ||
|
|
||
| // Update test links |
There was a problem hiding this comment.
Please provide test link example.
| private List<TrxLoggerObjectModel.UnitTestElement> testElements; | ||
| private List<TestEntry> entries; | ||
| private Dictionary<Guid, TrxLoggerObjectModel.ITestResult> results; | ||
| private Dictionary<Guid, TrxLoggerObjectModel.ITestResult> innerResults; |
|
Request a RFC and spec for this please. It will allow community to review the spec before the change is merged. |
| /// <summary> | ||
| /// Uri used to uniquely identify the TRX logger. | ||
| /// </summary> | ||
| public const string ExtensionUri = "logger://Microsoft/TestPlatform/TrxLogger/v1"; |
There was a problem hiding this comment.
public [](start = 8, length = 6)
nit: all these const should be near to the consumers. will be easy to read and understand
|
|
||
| string IXmlTestStoreCustom.NamespaceUri | ||
| { | ||
| get { return null; } |
There was a problem hiding this comment.
null [](start = 25, length = 4)
why null
| { | ||
| if (id == Guid.Empty) | ||
| { | ||
| Debug.Assert(id != Guid.Empty, "id == Guid.Empty!"); |
There was a problem hiding this comment.
Debug.Assert(id != Guid.Empty, "id == Guid.Empty!"); [](start = 15, length = 53)
remove assert
Changed trx logger to understand data driven and ordered test in hierarchical form
If test result contains parent execution id, then results are stored in hierarchical fashion. If not, stored in flat fashion.
Parent test result is expected to comes first than child results to allow results to be hierarchical.